﻿using System;
using System.Collections;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using System.Web.Caching;

namespace Jy123.Web.Game
{
    /// <summary>
    /// $codebehindclassname$ 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class GameLive : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            context.Response.Write("GOGOGO!!");
            context.Response.Flush();
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
        /// <summary>
        /// 获取指定的缓存
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public static object Get(string name)
        {
            return System.Web.HttpContext.Current.Cache.Get(name);
        }

        /// <summary>
        /// 删除指定的缓存
        /// </summary>
        /// <param name="name"></param>
        public static void Remove(string name)
        {
            System.Web.HttpContext.Current.Cache.Remove(name);
        }

        /// <summary>
        /// 设置Cache的值
        /// </summary>
        /// <param name="name">Cache的名称</param>
        /// <param name="objValue">Cache的值</param>
        /// <param name="cacheName"></param>
        public static void Set(string name, object objValue, CacheDependency cacheName)
        {
            System.Web.HttpContext.Current.Cache.Insert(name, objValue, cacheName, Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(15));
        }
    }
}
